#ifndef SETTINGS
#define SETTINGS 1

#include <math.h>
#include <string.h>
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>

#include "TTree.h"
#include "TObject.h"
#include "TVector3.h"
#include "TEnv.h"

#include "globals.hh"

#include "MiniBallTripleDetector.hh"

class Settings : public TObject
{
public:
  Settings(){};
  Settings(G4String,Int_t,Int_t,Bool_t);
  ~Settings(){};

  const char* BadStripsFile(){
    return fBadStripsFile.c_str();
  };

  void CreateBranches(TTree*);

public:
  Double_t TargetThickness;
  Double_t TargetThicknessInmgPercm2;
  Double_t TargetRadius;
  Double_t TargetAngle;
  Double_t TargetShift[3];
  Double_t BeamAngle;
  Double_t BeamDirection;
  G4String TargetMaterialName;
  Int_t TargetMaterialZ;
  Double_t TargetMaterialMole;
  Double_t TargetMaterialDensity;
  Int_t MiniballNb;
  Int_t MiniballType[8];
  Double_t MiniballRho[8];
  Double_t MiniballTheta[8];
  Double_t MiniballPhi[8];
  Double_t MiniballSpin[8];
  G4String MiniballName[8];
  Double_t MiniballRelativeEfficiency[8][3];

  ///definition of the silicon strip detector
  Double_t SSDInnerRad;
  Double_t SSDOuterRad;
  Double_t SSDPadOuterRad;
  Double_t fSSDThickness[4];
  Double_t bSSDThickness[4];
  Double_t feSSDThickness[4];
  Double_t beSSDThickness[4];
  Double_t SSDZPosition;
  Double_t SSDDeadLayer;
  Double_t SSDAngle;
  Double_t SSDRotation;
  Double_t CDEZPosition;

  ///definition of the silicon strip detector
  Double_t SSDActInnerRad;
  Double_t SSDActOuterRad;
  Double_t SSDPadActOuterRad;
  Double_t SSDActLength;
  Double_t SSDSegAngle;
  Double_t SSDAnnPitch;
  Double_t SSDAnnWidth;
  Double_t SSDRadPitch;

  ///definition of readout of the silicon strip detector
  Int_t NumberOfCDSectors;
  Int_t NumberOfCDRings;
  Int_t NumberOfCDStrips;

  ///definition of the PCB of the silicon strip detector
  Double_t SSDPCBInnerRad;
  Double_t SSDPCBOuterRad;
  Double_t SSDPCBStripThickness;
  Double_t SSDPCBPadThickness;

  ///definition of the barrel detectors
  Double_t ForwardBarrelZ;
  Double_t BackwardBarrelZ;
  Double_t BarrelDeltaEGap;
  Double_t fBarrelThickness[4];
  Double_t bBarrelThickness[4];
  Double_t feBarrelThickness[4];
  Double_t beBarrelThickness[4];
  Double_t BarrelLength;
  Double_t BarrelWidth;
  Double_t BarrelActLength;
  Double_t BarrelActWidth;
  Double_t BarrelStripPitch;
  Int_t ChannelsPerBarrelDetector;
  Double_t BarrelDisplacement;
  Double_t BarrelScaling;
  Double_t BarrelDistance;

  //definition of epoxy board of barrel detectors
  Double_t PCBLength;
  Double_t PCBWidth;
  Double_t ePCBWidth;
  Double_t PCBThickness;
  Double_t PCBRecessLength;
  Double_t PCBRecessWidth;

  //definition of chamber
  Double_t ChamberWallThickness;
  Double_t ChamberInnerRadius;
  Double_t ChamberFlangeConnectionThickness;
  Double_t ChamberForwardFlangeInnerRadius;
  Double_t ChamberForwardFlangeOuterRadius;
  Double_t ChamberForwardFlangeLength;
  Double_t ChamberForwardFlangeConnectionLength;
  Double_t ChamberBackwardFlangeInnerRadius;
  Double_t ChamberBackwardFlangeOuterRadius;
  Double_t ChamberBackwardFlangeLength;
  Double_t ChamberBackwardFlangeConnectionLength;
  Double_t ChamberTargetFlangeInnerRadius;
  Double_t ChamberTargetFlangeOuterRadius;
  Double_t ChamberTargetFlangeLength;
  Double_t ChamberTargetFlangeConnectionLength;
  Double_t ChamberLength;
  Double_t ChamberFrontThickness;
  Double_t ChamberBackThickness;

  //definition of screening foils
  Double_t CDFoilInnerRadius;
  Double_t CDFoilOuterRadius;
  Double_t CDFoilDistance;
  Double_t FCDFoilThickness;
  Double_t BCDFoilThickness;

  Double_t BDFoilDistance;
  Double_t FBDFoilThickness;
  Double_t BBDFoilThickness;
  Double_t BBDFoilHole;
  Double_t BBDVertFoilDistance;
  Double_t BBDVertFoilSize;

  string fBadStripsFile;
  int fBadStrips[2][4][16];



  //  ClassDef(Settings, 1);
};
#endif










